<% @page_title = " :: #{@audio_asset.name}" %>

<% content_for :sidebar do %>
	<div class="little_infos">
		<%= render :partial => 'shared/show_authors', :locals => { :authors => @authors } %>
	</div>
	
	<div class="little_infos">
		<%= related_tags_title %>
		<div id="tag_cloud" class="little_content">
			<%= render :partial => 'shared/tag_cloud', :locals => { :tags => @tags, :controller => 'audio_assets' } %>
		</div>
	</div>
<% end %>

<h1><%= "#{@audio_asset.name}" %></h1>

<div class="span-17 last">
	<p><label for="description">Description: </label><%= "#{@audio_asset.description}" %></p>
</div>

<hr class="separator" />
<div class="span-5">
	<p><label for="format">Format: </label><%= "#{@audio_asset.format}" %></p>
</div>

<div class="span-6">
	<p><label for="genre">Genre: </label><%= "#{@audio_asset.genre}" %></p>
</div>

<div class="span-6">
	<p><label for="download_counter">Downloaded: </label><%= pluralize(@audio_asset.download_counter, "time") %></p>	
</div>

<hr class="separator" />
<div class="span-5">
	<p><label for="length">Length: </label><%= "#{@audio_asset.length_in_megabytes} MB" %></p>
</div>

<div class="span-6">
	<p><label for="duration">Duration: </label><%= "#{@audio_asset.duration}" %></p>
</div>

<div class="span-6">
	<p><label for="expiration_date">Expiration Date: </label><%= "#{@audio_asset.expiration_date}" %></p>
</div>

<hr class="separator" />
<div class="span-17 last">
	<p><label>MD5 Hash: </label><%= "#{@audio_asset.md5_hash}" %></p>
</div>

<hr class="separator" />
<label for="availability">Availability: </label>
<%= image_tag(@audio_asset.available? ? "green_dot.png" : "red_dot.png") %><br /><br />

<p><%= link_to 'Download', :action => 'download', :id => @audio_asset if @audio_asset.essence_file? %><br />
<%= link_to 'Download Metadata', :action => 'download_metadata', :id => @audio_asset if @audio_asset.metadata_file? %></p>

<%= render :partial => 'shared/tagging', :locals => { :resource => @audio_asset, :controller => 'audio_assets' } %>

<% if @audio_asset.can_be_replicated_by(current_user) %>
	<%= '<hr class="main" /><br /><b>Replication:</b><br />' %>
	<div id="replication" class="span-15 push-1 centered_box_bordered">
		<%= render :partial => 'replication', :locals => { :audio_asset => @audio_asset, 
				:active_replication_systems => @active_replication_systems,
				:inactive_replication_systems => @inactive_replication_systems } %>
	</div>
<% end %>

<% unless @audio_asset.broadcasts.blank? %>
	<%= '<hr class="main" /><br /><b>Broadcasts</b> that contain this Audio Asset:<br />' %>
	<%= render :partial => 'broadcasts/list', :locals => { :broadcasts => @audio_asset.broadcasts } %>
<% end %>

<% unless @audio_asset.programs.blank? %>
	<%= '<hr class="main" /><br /><b>Programs</b> that contain this Audio Asset:<br />' %>
	<%= render :partial => 'programs/list', :locals => { :programs => @programs } %>
<% end %>